home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Include / Devices / Printer.i < prev    next >
Text File  |  1997-05-06  |  11KB  |  219 lines

  1. {
  2.         Printer.i for PCQ Pascal
  3. }
  4.  
  5.  
  6. {$I "Include:Exec/Nodes.i"}
  7. {$I "Include:Exec/Lists.i"}
  8. {$I "Include:Exec/Ports.i"}
  9.  
  10. Const
  11.  
  12.     PRD_RAWWRITE        = CMD_NONSTD + 0;
  13.     PRD_PRTCOMMAND      = CMD_NONSTD + 1;
  14.     PRD_DUMPRPORT       = CMD_NONSTD + 2;
  15.     PRD_QUERY           = CMD_NONSTD + 3;
  16.  
  17. { printer command definitions }
  18.  
  19.     aRIS        = 0;            { ESCc  reset                   ISO }
  20.     aRIN        = 1;            { ESC#1 initialize              +++ }
  21.     aIND        = 2;            { ESCD  lf                      ISO }
  22.     aNEL        = 3;            { ESCE  return,lf               ISO }
  23.     aRI         = 4;            { ESCM  reverse lf              ISO }
  24.  
  25.     aSGR0       = 5;            { ESC[0m normal char set        ISO }
  26.     aSGR3       = 6;            { ESC[3m italics on             ISO }
  27.     aSGR23      = 7;            { ESC[23m italics off           ISO }
  28.     aSGR4       = 8;            { ESC[4m underline on           ISO }
  29.     aSGR24      = 9;            { ESC[24m underline off         ISO }
  30.     aSGR1       = 10;           { ESC[1m boldface on            ISO }
  31.     aSGR22      = 11;           { ESC[22m boldface off          ISO }
  32.     aSFC        = 12;           { SGR30-39 set foreground color ISO }
  33.     aSBC        = 13;           { SGR40-49 set background color ISO }
  34.  
  35.     aSHORP0     = 14;           { ESC[0w normal pitch           DEC }
  36.     aSHORP2     = 15;           { ESC[2w elite on               DEC }
  37.     aSHORP1     = 16;           { ESC[1w elite off              DEC }
  38.     aSHORP4     = 17;           { ESC[4w condensed fine on      DEC }
  39.     aSHORP3     = 18;           { ESC[3w condensed off          DEC }
  40.     aSHORP6     = 19;           { ESC[6w enlarged on            DEC }
  41.     aSHORP5     = 20;           { ESC[5w enlarged off           DEC }
  42.  
  43.     aDEN6       = 21;           { ESC[6"z shadow print on       DEC (sort of) }
  44.     aDEN5       = 22;           { ESC[5"z shadow print off      DEC }
  45.     aDEN4       = 23;           { ESC[4"z doublestrike on       DEC }
  46.     aDEN3       = 24;           { ESC[3"z doublestrike off      DEC }
  47.     aDEN2       = 25;           { ESC[2"z NLQ on                DEC }
  48.     aDEN1       = 26;           { ESC[1"z NLQ off               DEC }
  49.  
  50.     aSUS2       = 27;           { ESC[2v superscript on         +++ }
  51.     aSUS1       = 28;           { ESC[1v superscript off        +++ }
  52.     aSUS4       = 29;           { ESC[4v subscript on           +++ }
  53.     aSUS3       = 30;           { ESC[3v subscript off          +++ }
  54.     aSUS0       = 31;           { ESC[0v normalize the line     +++ }
  55.     aPLU        = 32;           { ESCL  partial line up         ISO }
  56.     aPLD        = 33;           { ESCK  partial line down       ISO }
  57.  
  58.     aFNT0       = 34;           { ESC(B US char set or Typeface  0 (default) }
  59.     aFNT1       = 35;           { ESC(R French char set or Typeface  1 }
  60.     aFNT2       = 36;           { ESC(K German char set or Typeface  2 }
  61.     aFNT3       = 37;           { ESC(A UK char set or Typeface  3 }
  62.     aFNT4       = 38;           { ESC(E Danish I char set or Typeface  4 }
  63.     aFNT5       = 39;           { ESC(H Sweden char set or Typeface  5 }
  64.     aFNT6       = 40;           { ESC(Y Italian char set or Typeface  6 }
  65.     aFNT7       = 41;           { ESC(Z Spanish char set or Typeface  7 }
  66.     aFNT8       = 42;           { ESC(J Japanese char set or Typeface  8 }
  67.     aFNT9       = 43;           { ESC(6 Norweign char set or Typeface  9 }
  68.     aFNT10      = 44;           { ESC(C Danish II char set or Typeface 10 }
  69.  
  70. {
  71.         Suggested typefaces are:
  72.  
  73.          0 - default typeface.
  74.          1 - Line Printer or equiv.
  75.          2 - Pica or equiv.
  76.          3 - Elite or equiv.
  77.          4 - Helvetica or equiv.
  78.          5 - Times Roman or equiv.
  79.          6 - Gothic or equiv.
  80.          7 - Script or equiv.
  81.          8 - Prestige or equiv.
  82.          9 - Caslon or equiv.
  83.         10 - Orator or equiv.
  84. }
  85.  
  86.     aPROP2      = 45;           { ESC[2p  proportional on       +++ }
  87.     aPROP1      = 46;           { ESC[1p  proportional off      +++ }
  88.     aPROP0      = 47;           { ESC[0p  proportional clear    +++ }
  89.     aTSS        = 48;           { ESC[n E set proportional offset ISO }
  90.     aJFY5       = 49;           { ESC[5 F auto left justify     ISO }
  91.     aJFY7       = 50;           { ESC[7 F auto right justify    ISO }
  92.     aJFY6       = 51;           { ESC[6 F auto full justify     ISO }
  93.     aJFY0       = 52;           { ESC[0 F auto justify off      ISO }
  94.     aJFY3       = 53;           { ESC[3 F letter space (justify) ISO (special) }
  95.     aJFY1       = 54;           { ESC[1 F word fill(auto center) ISO (special) }
  96.  
  97.     aVERP0      = 55;           { ESC[0z  1/8" line spacing     +++ }
  98.     aVERP1      = 56;           { ESC[1z  1/6" line spacing     +++ }
  99.     aSLPP       = 57;           { ESC[nt  set form length n     DEC }
  100.     aPERF       = 58;           { ESC[nq  perf skip n (n>0)     +++ }
  101.     aPERF0      = 59;           { ESC[0q  perf skip off         +++ }
  102.  
  103.     aLMS        = 60;           { ESC#9   Left margin set       +++ }
  104.     aRMS        = 61;           { ESC#0   Right margin set      +++ }
  105.     aTMS        = 62;           { ESC#8   Top margin set        +++ }
  106.     aBMS        = 63;           { ESC#2   Bottom marg set       +++ }
  107.     aSTBM       = 64;           { ESC[Pn1;Pn2r  T&B margins     DEC }
  108.     aSLRM       = 65;           { ESC[Pn1;Pn2s  L&R margin      DEC }
  109.     aCAM        = 66;           { ESC#3   Clear margins         +++ }
  110.  
  111.     aHTS        = 67;           { ESCH    Set horiz tab         ISO }
  112.     aVTS        = 68;           { ESCJ    Set vertical tabs     ISO }
  113.     aTBC0       = 69;           { ESC[0g  Clr horiz tab         ISO }
  114.     aTBC3       = 70;           { ESC[3g  Clear all h tab       ISO }
  115.     aTBC1       = 71;           { ESC[1g  Clr vertical tabs     ISO }
  116.     aTBC4       = 72;           { ESC[4g  Clr all v tabs        ISO }
  117.     aTBCALL     = 73;           { ESC#4   Clr all h & v tabs    +++ }
  118.     aTBSALL     = 74;           { ESC#5   Set default tabs      +++ }
  119.     aEXTEND     = 75;           { ESC[Pn"x extended commands    +++ }
  120.  
  121.     aRAW        = 76;           { ESC[Pn"r Next 'Pn' chars are raw +++ }
  122.  
  123. Type
  124.  
  125.     IOPrtCmdReq = record
  126.         io_Message      : Message;
  127.         io_Device       : Address;      { (DevicePtr) device node pointer  }
  128.         io_Unit         : Address;      { (UnitPtr) unit (driver private)}
  129.         io_Command      : Short;        { device command }
  130.         io_Flags        : Byte;
  131.         io_Error        : Byte;         { error or warning num }
  132.         io_PrtCommand   : Short;        { printer command }
  133.         io_Parm0        : Byte;         { first command parameter }
  134.         io_Parm1        : Byte;         { second command parameter }
  135.         io_Parm2        : Byte;         { third command parameter }
  136.         io_Parm3        : Byte;         { fourth command parameter }
  137.     end;
  138.     IOPrtCmdReqPtr = ^IOPrtCmdReq;
  139.  
  140.  
  141.     IODRPReq = record
  142.         io_Message      : Message;
  143.         io_Device       : Address;      { (DevicePtr) device node pointer  }
  144.         io_Unit         : Address;      { (UnitPtr) unit (driver private)}
  145.         io_Command      : Short;        { device command }
  146.         io_Flags        : Byte;
  147.         io_Error        : Byte;         { error or warning num }
  148.         io_RastPort     : Address;      { (RastPortPtr) raster port }
  149.         io_ColorMap     : Address;      { (ColorMapPtr) color map }
  150.         io_Modes        : Integer;      { graphics viewport modes }
  151.         io_SrcX         : Short;        { source x origin }
  152.         io_SrcY         : Short;        { source y origin }
  153.         io_SrcWidth     : Short;        { source x width }
  154.         io_SrcHeight    : Short;        { source x height }
  155.         io_DestCols     : Integer;      { destination x width }
  156.         io_DestRows     : Integer;      { destination y height }
  157.         io_Special      : Short;        { option flags }
  158.     end;
  159.     IODRPReqPtr = ^IODRPReq;
  160.  
  161. Const
  162.  
  163.     SPECIAL_MILCOLS     = $0001;        { DestCols specified in 1/1000" }
  164.     SPECIAL_MILROWS     = $0002;        { DestRows specified in 1/1000" }
  165.     SPECIAL_FULLCOLS    = $0004;        { make DestCols maximum possible }
  166.     SPECIAL_FULLROWS    = $0008;        { make DestRows maximum possible }
  167.     SPECIAL_FRACCOLS    = $0010;        { DestCols is fraction of FULLCOLS }
  168.     SPECIAL_FRACROWS    = $0020;        { DestRows is fraction of FULLROWS }
  169.     SPECIAL_CENTER      = $0040;        { center image on paper }
  170.     SPECIAL_ASPECT      = $0080;        { ensure correct aspect ratio }
  171.     SPECIAL_DENSITY1    = $0100;        { lowest resolution (dpi) }
  172.     SPECIAL_DENSITY2    = $0200;        { next res }
  173.     SPECIAL_DENSITY3    = $0300;        { next res }
  174.     SPECIAL_DENSITY4    = $0400;        { next res }
  175.     SPECIAL_DENSITY5    = $0500;        { next res }
  176.     SPECIAL_DENSITY6    = $0600;        { next res }
  177.     SPECIAL_DENSITY7    = $0700;        { highest res }
  178.     SPECIAL_NOFORMFEED  = $0800;        { don't eject paper on gfx prints }
  179.     SPECIAL_TRUSTME     = $1000;        { don't reset on gfx prints }
  180.  
  181. {
  182.         Compute print size, set 'io_DestCols' and 'io_DestRows' in the calling
  183.         program's 'IODRPReq' structure and exit, DON'T PRINT.  This allows the
  184.         calling program to see what the final print size would be in printer
  185.         pixels.  Note that it modifies the 'io_DestCols' and 'io_DestRows'
  186.         fields of your 'IODRPReq' structure.  Also, set the print density and
  187.         update the 'MaxXDots', 'MaxYDots', 'XDotsInch', and 'YDotsInch' fields
  188.         of the 'PrinterExtendedData' structure.
  189. }
  190.  
  191.     SPECIAL_NOPRINT     = $2000;        { see above }
  192.  
  193.     PDERR_NOERR         = 0;            { clean exit, no errors }
  194.     PDERR_CANCEL        = 1;            { user cancelled print }
  195.     PDERR_NOTGRAPHICS   = 2;            { printer cannot output graphics }
  196.     PDERR_INVERTHAM     = 3;            { OBSOLETE }
  197.     PDERR_BADDIMENSION  = 4;            { print dimensions illegal }
  198.     PDERR_DIMENSIONOVFLOW       = 5;    { OBSOLETE }
  199.     PDERR_INTERNALMEMORY        = 6;    { no memory for internal variables }
  200.     PDERR_BUFFERMEMORY  = 7;            { no memory for print buffer }
  201.  
  202. {
  203.         Note : this is an internal error that can be returned from the render
  204.         function to the printer device.  It is NEVER returned to the user.
  205.         If the printer device sees this error it converts it 'PDERR_NOERR'
  206.         and exits gracefully.  Refer to the document on
  207.         'How to Write a Graphics Printer Driver' for more info.
  208. }
  209.  
  210.     PDERR_TOOKCONTROL   = 8;            { Took control in case 0 of render }
  211.  
  212. { internal use }
  213.  
  214.     SPECIAL_DENSITYMASK = $0700;        { masks out density values }
  215.     SPECIAL_DIMENSIONSMASK = SPECIAL_MILCOLS + SPECIAL_MILROWS +
  216.                         SPECIAL_FULLCOLS + SPECIAL_FULLROWS + SPECIAL_FRACCOLS +
  217.                         SPECIAL_FRACROWS + SPECIAL_ASPECT;
  218.  
  219.